How do I setup Calibre Companion to connect to calibre?


We have tried very hard to make Calibre Companion able to automatically connect to calibre in many different network setups and situations. Unfortunately there are as many different network setups as there are networks and operating systems, and some combinations are unusual or complicated enough to defeat auto-connection.

Connecting the first time

The first thing to try is "automatic" connection. To do this, first ensure that you have started the wireless device driver in calibre. Click on Connect/Share, then “Start wireless device connection”.

Now attempt to connect CC to calibre. In CC, tap Connect, then As Wireless Device. Normally this is all you will need to do.

Note: devices connected by a USB cable to the computer running calibre can interfere with CC's connections, especially if the devices are readers or phones. Unplug them and try again before going to the next steps.

Troubleshooting

In some situations where the networking setup is unusual or complex, Calibre Companion will fail to connect. If this is your situation, continue with the steps below to troubleshoot the problem. Note: years of experience has shown us that these steps will in the vast majority of cases find the problem. The steps are ordered from "fundamental" tests to more application-oriented tests. If you know what you are doing then you can run the tests in whatever order you wish. Also note that these steps are oriented towards Windows for two reasons: 1) 83% of calibre users run on Windows, and 2) I don't own a Mac.

The steps:

  1. Ensure that no portable device such as a phone is plugged into the computer running calibre, even if just for "charging". Calibre can connect with only one device at a time. When it sees a plugged-in device it tries to connect to it. Even if the connect fails, as it will if calibre doesn't know about the device, the process can block attempts to connect with other devices including the Wireless Device. Try unplugging everything you can then attempt to connect as a wireless device. If the connection works then something you unplugged is confusing calibre.

    Also check if iTunes is running on the calibre computer. Some users have told us that calibre will sometimes attempt to use iTunes as a "device", which prevents calibre connecting to other devices.
  2. Verify Network Connectivity
    1. If the computer running calibre is running Windows, verify the "Network Location" is correct. If the network location is "Public" then your device will not be able to connect to calibre. 

      For Windows 10, check that the network is "Private" and that the computer running calibre is "discoverable". See this tutorial for more information.

      For Windows 7, check that the connection is not "Public", but is instead "Home" or (sometimes) "Work". The tutorial Simple Questions: What are Network Locations in Windows 7 & Windows 8? might help.
    2. Check that your WiFi router is not using "Guest Mode" or "Wireless/SSID Isolation". Wireless isolation and guest mode are two different techniques for securing a wireless network. Although the details are different, they both prevent wireless devices from connecting to computers using a cabled connection, and in many cases prevent wireless devices from connecting to other wireless devices. How these are set up varies a lot from router to router. For more information about these two modes, see  Why does enabling wireless Guest Mode or Wireless Isolation prevent CC connections?
    3. If the computer running calibre is using WiFi to connect to the network, check that it is using the same network "band" that the Android devices are using. Many home routers come with 2 WiFi bands: 2.4 GHz and 5 GHz. Routers are often set up to ensure that devices using one band often cannot talk to devices using the other band. Either ensure that all the devices including the computer running calibre are using the same band, or ensure that your router permits devices on one band to talk to devices on the other.
    4. A Linux Mint user reported that he needed to adjust some base-level settings when using UFW (Uncomplicated FireWall). The following fixed it for him. Something like it might be required/work on other Linux distros.

      Problem
      : On the PC after setting a ufw (uncomplicated fire wall) port rule for 9090 I still could not get a connection from CC to Calibre.

      PC log file ' /var/log/syslog' reporting: ‘kernel: TCP: request_sock_TCP: Possible SYN flooding on port 9090. Dropping request. Check SNMP counters.’

      Solution
      : Edit PC file: ‘/etc/ufw/sysctl.conf’, Set: ‘net/ipv4/tcp_syncookies=1’ (was ‘0’). There are multiple 'sysctl.conf’ files on my system but ‘/etc/ufw/sysctl.conf’ was the one that solved my connectivity problem.

      PC log '/var/log/syslog' now reporting: ‘kernel: TCP: request_sock_TCP: Possible SYN flooding on port 9090. Sending cookies. Check SNMP counters.’

      CC now connects to Calibre with the defaults, (no ip address or port specified). My PC is running Linux Mint 18.3 Cinnamon 64 bit.
  3. Verify your firewall and anti-virus settings
    1. Check that your firewall is allowing calibre to send and receive messages. For example, in Windows 7/10, go to the control panel, select Windows Firewall, and click "Allow a program or feature through Windows Firewall". Scroll down the list until you see "The main calibre program". Ensure that it has a check mark on the left side and (at least) in the "Home/Work (Private) column.

      Some firewalls don't support application-based permissions, in which case you will need to use a fixed port (see below) and open that port in your firewall.

      As there are many firewalls, most of which we do not have, we are unable to give more instructions for opening a port in the firewall. However, if you have McAfee, user feedback indicates that two settings must be checked: which programs are allowed to access the internet and whether the "home network" is trusted. Calibre should have "Full" access to the internet and the home network should be marked as fully trusted. If you look at the network map in McAfee, you should see your device and it should be trusted.
    2. (By far the most common problem) Check that your antivirus/antimalware package is not blocking connections. This is not a problem if you are running Microsoft Security Essentials. We have heard that MalwareBytes and "ESET Smart Security" can block connections between CC and calibre. In general, if you are running a network "Security Suite" then be sure that it allows traffic to and from calibre. One way to do that might be to "exclude" calibre from checks. It is also possible that you will need to use a fixed port (see below).
  4. Check that the computer running calibre is not using a Virtual Private Network (VPN). If you don't know what a VPN is then you probably aren't using one. Smile Using a VPN can make it impossible for Calibre Connection to connect to calibre. If you are in this situation then the only solution might be to turn off the VPN.
  5. Connection testing
    1. Check that the computer running calibre can "see" the device. On the device, get its IP address (CC can tell you that in Settings / Connecting to calibre / Wireless Device). On the computer running calibre, open a command window/terminal and run the command "ping device-ip-address" (without the quotes using the address you found earlier). If ping says it can't see the device then your problem is not in CC or calibre, but is instead in the network setup. You can also do the reverse, check from the device, by installing an app like "Ping & DNS" then pinging the computer running calibre.
    2. Using CC and calibre defaults, attempt to connect. If the connection fails then run calibre getting a "debug log", which will tell tell you if it "heard" the connection request. See our FAQ How do I get help to see how to get a calibre debug log.
    3. If calibre heard the connection request but CC failed to connect then with almost 100% probability the problem is the firewall or the antivirus on the computer running calibre.
    4. If calibre doesn't hear the connection request then the problem can be anywhere in the network between CC and calibre. I still suspect the firewall and AV, but one must also look at the network (isolation, guest, private networks, a wonky WiFi router).
    5. If you still cannot connect and if you are running Windows, you can determine if something on the computer running calibre is blocking connections by starting windows in "Safe mode with networking". How you start windows like this depends on the version of windows you are running. Use these instructions if you are running Windows 10. Use these instructions if you are running windows 8 or 8.1. Use these instructions if you are running Vista or Windows 7. Once your computer is running in safe mode with networking, start calibre and attempt to connect CC. If it connects then some software on your computer is blocking connections, almost certainly a firewall, anti-virus, or "network security suite". NB: sometimes safe mode with networking does not work if your computer is connected to the network using WiFi. You can check this by trying to go to some internet site using whatever web browser you normally use.
  6. If after making the above checks Calibre Companion still cannot connect to calibre then the next step is to use a fixed port and enter calibre’s IP address and port into Calibre Companion. See the instructions below. 
  7. In rare cases rebooting all the devices on the network including the router can fix problems. The sequence: turn off all the devices on the local network, reboot the router, then turn the devices on one by one.

Using a fixed IP address and port

Note: if using a fixed IP address fixes connection problems then almost certainly something on the network is strange. Something is blocking UDP packets, mDNS (Bonjour) packets, or both; or the firewall isn't allowing calibre to receive the packets. The steps above should help you determine what that "something" is. That said, using a fixed IP address/port is sometimes the easiest fix.

If Calibre Companion does not connect automatically and you went through the steps described above, then telling CC to connect using a fixed IP address and port might fix the problem. An IP address is a group of 4 numbers separated by periods, for example 192.168.0.44 , and a port is a single number, for example 9090.

First, follow these steps to try using a fixed port:

  1. In calibre, go to wireless connection menu shown above. If it says "Stop wireless device connection", click it and answer the question about auto-connection (however as you wish), then click the menu "Start wireless device connection" again. You will see the following dialog box.

    Check the box "Use a fixed network port". Change the default port number (9090) if you wish. You must not enter the same port used by calibre's content server. Press OK. Calibre will complain if there is a problem with the port, for example if it is being used by another application on your computer.
  2. Be sure that any firewall you are running on the computer running calibre allows incoming connections to the chosen port.

Before going on to the next steps, try to connect Calibre Companion to calibre. In many situations, simply setting a fixed port in calibre and opening that port on your the firewall will be enough to permit Calibre Companion to connect.

If connection still does not work, then the next step is to enter calibre's IP address into Calibre Companion. Follow the steps below to do this.

  1. Click again on calibre's connect/share menu. Assuming that the wireless driver is running (a green dot is shown next to the menu line), you will see calibre’s IP address and port on the menu line. If you do not see the port then something went wrong when you checked the "Used fixed port" box as described above and you should follow those instructions again. If all went well, you should see something similar to the following:

    Make a note the displayed IP address and port.Important note: If you see more than one IP address, read the answer to "My computer has more than one IP address. Which one do I use?" below.
  2. Enter calibre's IP address into Calibre Companion on your device. To do this, tap CC's “Settings” menu item.


    You will see this dialog.


    Tap"Connection Settings" to open the following dialog


    Tap the Wireless Device Connection line. The following dialog opens.


    Tap "IP address and port" to enter the IP address.

    Enter the IP address and port that you saw in the step above. You must enter the IP address exactly as it was shown in calibre, without any spaces or extra periods.

    As an aide, Calibre Companion's dialog shows you the IP address of your device. The IP address for Calibre you noted should be very similar to the one CC shows. For example, if your device's IP address begins with 192.168.203 then calibre's IP address should also begin with 192.168.203. 

    You must always enter both an IP address and a port number. You must not enter the port used by calibre's content server or any other web server.

If after all of this Calibre Companion still cannot connect, ask for help on our support forum. Calibre Companion's help menu has a button that will connect you to the forum. You will need to have a user name and password; create these if necessary. In your post, please give us all the IP addresses that calibre displays, and the IP address of your device you found as described above. Also give us the port number that you set up.

Connections worked, but have stopped working

It is possible that connections work for a time then stop working. The most common reason connections stop working is a calibre was updated and is no longer allowed through the filewall, or that the antivirus has updated itself and now thinks calibre is malware. Check the settings as described above.

Another possibility is that you put an IP address into CC, and subsequently the computer running calibre changed its IP address. The can happen if that computer has not connected to the home network for some time (e.g., a laptop that was traveling), or if there was a general power failure and the home network controller box (the "router") was restarted. If Calibre Companion has been successfully connecting but suddenly stops, then verify that the IP address entered in Calibre Companion still matches the one displayed by calibre. If it does not, then change the address in CC to match the new IP address shown in calibre.

Technical Notes:

Technical note 1: You can avoid having calibre's IP address change by setting up a "static lease" for that computer in your home network router. How to do this, or even if it can be done, depends on your router. The setup is usually in the DHCP setup section. Check the manual for your router to see how to set up static leases. Note that your router may call these something else, such as fixed IP addresses or static IP addresses.


Technical note 2: Calibre Companion will accept domain names in lieu of IP addresses. This can be useful if you are on a routed network or if calibre is on a machine that doesn't have a fixed IP address and you have access to a dynamic DNS server.

 

Author:
Charles Haley
Revision:
1.5
Average rating: 5 (1 Vote)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.